import { Injectable } from '@angular/core';
import {Http, Headers, RequestOptions} from '@angular/http';

@Injectable()
export class MapService {

  constructor(private http: Http) { }

  localSearch(query: string, region: string) {
    // const headers = new Headers({'Content-Type': 'application/json'});
    // const options = new RequestOptions({headers: headers});
    return this.http.get(`http://api.map.baidu.com/place/v2/search?query=${query}&region=${region}&ak=YOCtu8vnlsHhsYTchlX43fFAyIm47ECv&output=json`).map(response => response.json());
  }
}
